


class Solution {
public:
    vector<int> findDisappearedNumbers(vector<int>& nums) {
        vector<int> ans;
        int n=nums.size();
        for(int i=0;i<n;i++)
        {
            int ret=abs(nums[i])-1;
            if(nums[ret]>0)
            {
                nums[ret]=-nums[ret];
            }
        }

        for(int i=0;i<n;i++)
        {
            if(nums[i]>0)
            ans.emplace_back(i+1);
        }
       return ans;
    }
};